﻿using Exam.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Exam.Service
{
    public class SysUserServiceImp : Repository<SysUser>, ISysUserService
    {
        private readonly Exam.DBManager.IDbManager m_Manager;

        public SysUserServiceImp(Exam.DBManager.IDbManager m_Manager) : base(m_Manager)
        {
            this.m_Manager = m_Manager;
        }
        public SysUser Login(string ac, string pd)
        {
            SysUser sysUser = m_Manager.Exam.SysUsers.FirstOrDefault(o => o.account == ac && o.password == pd && o.state == true)!;
            return sysUser;
        }
    }
}
